
/*----------Validation-----------*/
var emailPattern=  /^\w+@[a-zA-Z_]+?\.[a-zA-Z]{2,3}/;
document.getElementById("submit").onclick = function SubmitForm()
{   
	
        // TextBox Name
        if(document.getElementById('inputName').value== '')
        {
            document.getElementById('name_warning').className="active";
            return false;
        }else
        {
          document.getElementById('name_warning').className="hidden";          
        }
  
        // TextBox Email
        if(document.getElementById('inputEmail').value== '' || !emailPattern.exec(document.getElementById('inputEmail').value))
        {
            document.getElementById('email_warning').className="active";
            return false;
        }else
        {
            document.getElementById('email_warning').className="hidden";
        }
    
        // Dropdownlist subject
        if(document.getElementById('inputSubject').selectedIndex== 0)
        {
          document.getElementById('subject_warning').className="active";
          return false;
        }    
        else
        {
          document.getElementById('subject_warning').className="hidden";   
        }
   
        // TextArea Message     
        if(document.getElementById('inputArea').value== "")
        {
          document.getElementById('message_warning').className="active";
          return false;
        }
        else
        {
          document.getElementById('message_warning').className="hidden";  
        }


    
    
}// validation ends


